package com.markus.code.exam.tencent;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
 * Author:markusZhang
 * Date:Create in 2020/9/6 20:03
 * todo:
 */
public class Main3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] arr = new int[n];
        int[] arrTemp = new int[n];
        for (int i = 0; i < n; i++) {
            int temp = scanner.nextInt();
            arr[i] = temp;
            arrTemp[i] = temp;
        }
        Arrays.sort(arr);
        int ans1 = arr[n / 2 - 1];
        int ans2 = arr[n / 2];
        for (int i = 0; i < n; i++) {
            if (arrTemp[i] <= ans1) {
                System.out.println(ans2);
            } else {
                System.out.println(ans1);
            }
        }
    }
}